xl: fix vcpus to vnode assignement in config file
authorDario Faggioli <dario.faggioli@citrix.com>
Tue, 21 Jul 2015 17:31:57 +0000 (19:31 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 22 Jul 2015 14:16:56 +0000 (15:16 +0100)
commita08b914807b14a8328d005079d774e7f8efd1d24
treee11af9001220247ad272de5a19f20862f91c7294
parentbc299d01b925d934219b6e8c29fadcd1f1a9210b
xl: fix vcpus to vnode assignement in config file

In fact, right now, the following (legitimate)
configuration:

 vcpus       = '4'
 vnuma = [ [ "pnode=0","size=512","vcpus=0,1","vdistances=10,20"  ],
           [ "pnode=1","size=512","vcpus=2,3","vdistances=20,10"  ] ]

Produces the following error:

 # xl create /etc/xen/test.cfg
 Parsing config from /etc/xen/test.cfg
 xl: maxvcpus < vcpu

That is because, we only process the first element of the
"vcpus=" list (of each vnode specification). Therefore,
in the above case, we only see 2 vcpus, out of 4, being
assigned to the vnodes, and hence the error.

What we need is either a multidimentional array, or a
bitmap, to temporary store the vcpus of a vnode, while
parsing the vnuma config entry. Let's use the latter,
which happens to also make it easier to copy the outcome
of the parsing to its final destination in b_info, if
everything goes ok.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/xl_cmdimpl.c